/*
 * @Description: 日志操作
 * @Author: pinus
 * @Email: pinus0716@163.com
 * @Git: https://gitee.com/xyf97
 * @Date: 2021-10-07 11:16:57
 * @LastEditTime: 2021-10-07 16:27:52
 */
const log4js = require('log4js')

log4js.configure({
  appenders: {
    cheese: {
      type: 'file',
      filename: 'cheese.log'
    }
  },
  categories: {
    default: {
      appenders: ['cheese'],
      level: 'error'
    }
  }
})

exports.logger = function (level) {
  const logger = log4js.getLogger('cheese')
  logger.level = 'debug'
  return logger
}
